package cn.org.custom.server.constants;

import cn.org.custom.protocol.MessageCodecSharable;
import cn.org.custom.server.handler.*;
import cn.org.custom.server.requestHandler.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.timeout.IdleStateHandler;


public class Constants {
    /**
     * Boss
     * worker
     */
    public static final NioEventLoopGroup boss = new NioEventLoopGroup();
    public static final NioEventLoopGroup worker = new NioEventLoopGroup();
    /**
     * 日志打印处理器
     */
    public static final LoggingHandler LOGGING_HANDLER = new LoggingHandler(LogLevel.DEBUG);
    /**
     * 心跳
     */
    public static final HeartBeatHandler HEART_BEAT_HANDLER = new HeartBeatHandler();
    public static final IdleStateHandler IDLE_STATE_HANDLER = new IdleStateHandler(6, 0, 0);
    /**
     * 共享编解码器
     */
    public static final MessageCodecSharable MESSAGE_CODEC = new MessageCodecSharable();
    /**
     * 自定义处理器【接收的request消息体有对应的handler处理 并返回对应的response消息体】
     */
    public static final LoginRequestMessageHandler LOGIN_HANDLER = new LoginRequestMessageHandler();
    public static final ChatRequestMessageHandler CHAT_HANDLER = new ChatRequestMessageHandler();
    public static final GroupCreateRequestMessageHandler GROUP_CREATE_HANDLER = new GroupCreateRequestMessageHandler();
    public static final GroupJoinRequestMessageHandler GROUP_JOIN_HANDLER = new GroupJoinRequestMessageHandler();
    public static final GroupMembersRequestMessageHandler GROUP_MEMBERS_HANDLER = new GroupMembersRequestMessageHandler();
    public static final GroupQuitRequestMessageHandler GROUP_QUIT_HANDLER = new GroupQuitRequestMessageHandler();
    public static final GroupChatRequestMessageHandler GROUP_CHAT_HANDLER = new GroupChatRequestMessageHandler();
    public static final QuitHandler QUIT_HANDLER = new QuitHandler();
    public static final PingMessageHandler PING_MESSAGE_HANDLER = new PingMessageHandler();
}
